Ooops, little bug with the cross product.
[andmenj-acm.git] / 10302 - Summation of polynomials / 10302.cpp
blob50fa6053482ff26117228f4ab353062d567f4643
1 using namespace std;
2 #include <algorithm>
3 #include <iostream>
4 #include <iterator>
5 #include <sstream>
6 #include <fstream>
7 #include <cassert>
8 #include <climits>
9 #include <cstdlib>
10 #include <cstring>
11 #include <string>
12 #include <cstdio>
13 #include <vector>
14 #include <cmath>
15 #include <queue>
16 #include <deque>
17 #include <stack>
18 #include <list>
19 #include <map>
20 #include <set>
22 #define foreach(x, v) for (typeof (v).begin() x = (v).begin(); x != (v).end(); ++x)
23 #define D(x) cout << #x " is " << x << endl
25 const int MAXN = 50000;
26 long long s[MAXN+1];
28 int main(){
29 s[0] = 0;
30 for (long long i=1; i<=MAXN; ++i){
31 s[i] = s[i-1] + i*i*i;
34 int n;
35 while (scanf("%d", &n)) printf("%lld\n", s[n]);
37 return 0;